Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateProcess needs CREATE_UNICODE_ENVIRONMENT #903

Merged

Conversation

MisterDA
Copy link
Contributor

If the environment block pointed to by lpEnvironment contains
Unicode characters, be sure that dwCreationFlags includes
CREATE_UNICODE_ENVIRONMENT. If this parameter is NULL and the
environment block of the parent process contains Unicode characters,
you must also ensure that dwCreationFlags includes
CREATE_UNICODE_ENVIRONMENT.

From doc1.

If this flag is set, the environment block pointed to by
lpEnvironment uses Unicode characters. Otherwise, the environment
block uses ANSI characters.

From doc2.

This was forgotten from PR #843 that switched to Unicode strings on
Windows (including the environment). I noticed it when reading code
from win32unix.

> If the environment block pointed to by lpEnvironment contains
> Unicode characters, be sure that dwCreationFlags includes
> CREATE_UNICODE_ENVIRONMENT. If this parameter is NULL and the
> environment block of the parent process contains Unicode characters,
> you must also ensure that dwCreationFlags includes
> CREATE_UNICODE_ENVIRONMENT.

From [doc1][].

> If this flag is set, the environment block pointed to by
> lpEnvironment uses Unicode characters. Otherwise, the environment
> block uses ANSI characters.

From [doc2][].

This was forgotten from PR ocsigen#843 that switched to Unicode strings on
Windows (including the environment).

[doc1]: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw
[doc2]: https://docs.microsoft.com/en-us/windows/win32/procthread/process-creation-flags#CREATE_UNICODE_ENVIRONMENT
@smorimoto smorimoto merged commit d5f8452 into ocsigen:master Nov 23, 2021
@smorimoto
Copy link
Member

Thanks @MisterDA!

@MisterDA MisterDA deleted the windows-create-process-unicode-env branch November 23, 2021 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants